<template>
	<page-body>
		<view class="page">
			<!---flex布局flex布局开始-->
			<view class="flex flex-wrap align-start benben-flex-layout trends_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between trends_fd0_0'>
					<view class="btns">
						<text class='fu-iconfont2  trends_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
							data-url="1">&#xe794;</text>
					</view>
					<view class='flex flex-wrap align-center'>
						<text class='trends_fd0_0_c1_c0'>红色专题</text>
					</view>
					<view class="btns">
						<!-- 	<text class='fu-iconfont2  trends_fd0_0_c2' @tap.stop="handleJumpDiy" data-type="navigateTo"
								:data-url="`/pageguofang/honoDeta/search/search?are=3`">&#xe722;</text> -->
					</view>
				
				</view>
			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>

			<!---flex布局flex布局结束-->
			<!---flex布局flex布局开始-->
			<view class="flex benben-flex-layout flex-wrap align-center trends_flex_1">
				<view>
					<benben-flex-tabs class-name='trends_benbenTabsfd1_0' v-model="tabLab" ref="benben_tabsfd1_0"
						select-mark="benben_tabsfd1_0" key="benben_tabsfd1_0" :open-title-type='false'
						:open-sticky='false' :top='0' :is-show-content='false' :scrollspy='true'
						:tabs-info.sync="tabsInfofd1_0" @change="articleunFunc()" v-if=" tabsShow===true">

						<scroll-view @scroll="tabsInfofd1_0.scrollX = $event.detail.scrollLeft" id="benben_tabsfd1_0"
							class="benben-tabs" style="width:750rpx" :scroll-x="true" :scroll-left="tabsInfofd1_0.moveX"
							scroll-with-animation="all .3s ease">
							<view class="benben-tabs-content" id="benben_tabsfd1_0-content">
								<view id="benben_tabsfd1_0-title"
									class="benben-tabs-title flex flex align-center justify-around">
									<template v-for='(item,key0) in tabs'>
										<view :key='key0'
											:class="{ 'checkTitlefd1_0': tabLab == item.aid, 'flex flex-wrap align-center trends_titlefd1_0_c3': true }"
											@tap="tabLab = item.aid" :id="`benben_tabsfd1_0-title-item-${item.aid}`">

											<text class='trends_titleItemfd1_0_c3_c0'>{{item.name}}</text>

										</view>
									</template>
								</view>
								<view :style="{ left: tabsInfofd1_0.lineleft, maxWidth: tabsInfofd1_0.lineWidth ,}"
									id="benben_tabsfd1_0-line"
									class="benben-tabs-line flex benben-flex-tabs-line trends_linefd1_0">
								</view>
							</view>
						</scroll-view>

					</benben-flex-tabs>
				</view>
			</view>

			<!---flex布局flex布局结束-->
			<!---轮播图flex布局开始-->
			<!-- <scroll-view :scroll-y="true" :show-scrollbar='true' :refresher-enabled='true' @refresherrefresh="getAjax"
        :refresher-triggered="isShow"> -->
			<view class="flex flex-wrap align-center justify-center benben-flex-layout trends_flex_2">
				<view style="position: relative">
					<swiper ref="benbenSwiperfd2_0" @change="bannerIndexfd2_0 = $event.detail.current"
						class='flex position-relative trends_fd2_0' previous-margin="0rpx" next-margin="0rpx"
						:display-multiple-items="1" :interval="5000" :duration="500" :autoplay='true' :circular='true'>

						<template v-for='(item,key0) in banner_list'>
							<swiper-item class='flex' :key='key0'>
								<image class='trends_fd2_0_c1_c0' mode="aspectFill" :src='item.thumb'></image>
							</swiper-item>
						</template>

					</swiper>


					<view style="position: absolute"
						class="flex dot flex align-center justify-center trends_swiperDotfd2_0">
						<template v-for="(item, index) in (banner_list.length)">
							<view :key="index" v-if="bannerIndexfd2_0 == index"
								class="flex dot selected flex align-center justify-center trends_swiperDotSelectedfd2_0">
							</view>
							<view :key="index" v-else
								class="flex dot unselected flex align-center justify-center trends_swiperDotUnselectedfd2_0">
							</view>
						</template>
					</view>


				</view>
			</view>

			<!---轮播图flex布局结束-->
			<!---flex布局flex布局开始-->

			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout trends_flex_3">
				<template v-for='(item,key0) in article'>
					<view class='flex flex-wrap align-center trends_fd3_0' @tap.stop="handleJumpDiy"
						data-type="navigateTo" :data-url="`/pageguofang/guofang/particular/particular?aid=${item.aid}`"
						:key='key0'>
						<view
							class='flex flex-direction flex-wrap align-stretch self-start justify-between trends_fd3_0_c0'>
							<text class='trends_fd3_0_c0_c0'>{{item.title}}</text>
							<view class='flex flex-wrap align-center trends_fd3_0_c0_c1'>
								<text class='trends_fd3_0_c0_c1_c0'>{{item.create_time}}</text>
							</view>
						</view>
						<image class='trends_fd3_0_c1' mode="aspectFill" :src='item.thumb'></image>
					</view>
				</template>
				<fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
					:listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
			</view>
			<!-- </scroll-view> -->
			<!---flex布局flex布局结束-->


		</view>
	</page-body>
</template>
<script>
	import pagingList from '@/common/mixin/paging_list.js';
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},
		mixins: [pagingList],

		data() {
			return {
				"bannerIndexfd2_0": 0,
				"tabsInfofd1_0": {
					lineleft: '',
					lineWidth: '',
					moveX: 0,
					scrollX: 0,
					PageScrollX: 0
				},
				"minixPagingListsApi": "",
				"pageingListApiMethod": "",
				"allowOnloadGetList": false,
				"banner_list": [],
				"article": [],
				"tabs": [],
				"tabLab": 0,
				"tabsShow": false,
				red: null,
				isShow: false,
			};
		},
		computed: {

		},
		watch: {},
		onLoad(options) {
			let {
				red
			} = options
			if (red != undefined) this.red = red
			this.articleunFunc()
			this.getwc6bda39629cbfFunc()
			this.getjt36e02b419726Func()
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {
			uni.setStorageSync("are", 3)
		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {
			this.articleunFunc()
			this.getwc6bda39629cbfFunc()
			this.getjt36e02b419726Func()
		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			getAjax() {
				var that = this;
				if (!that.isShow) {
					that.isShow = true;
					//下拉加载，先让其变true再变false才能关闭
					//关闭加载状态 ，需要一点延时才能关闭
					// this.get_banner_listFunc()
					this.getjt36e02b419726Func()
					this.articleunFunc()
					setTimeout(() => {
						that.isShow = false;
					}, 200)
				}
			},
			//文章列表
			articleunFunc() {
				this.minixPagingListsApi = global.apiUrls.post66bdaadbb332a;
				this.pageingListApiMethod = 'get';
				this.allowOnloadGetList = false;
				this.pagingListPostDataContent = {
					soldiercate_id: this.tabLab,
					// is_sell: '3'
				}
				this.listData = [];
				this.article = this.listData;
				this.pagingListToggle();

			},
			//查询征兵分类
			async getwc6bda39629cbfFunc() {
				//请求方法
				//数据验证

				let datatabs = await this.$api.get(global.apiUrls.post66bda39629cbf, {

				});

				if (datatabs.data.code != 1) {
					this.$message.info(datatabs.data.msg);
					return
				}
				let infotabs = datatabs.data;
				this.tabs = infotabs.data


				this.tabs.unshift({
					aid: null,
					is_lock: 0,
					is_show: "1",
					is_show_name: "否",
					name: "综合",
					sort: 1,
					thumb: "https://cloud.saizhuge.net/static/admin/images/none.png",
				})
				this.tabLab = this.tabs[0].aid
				this.tabsShow = true;
				this.$forceUpdate();
			},
			//广告-广告列表
			async getjt36e02b419726Func() {
				//请求方法
				//数据验证

				let databanner_list = await this.$api.get(global.apiUrls.post641e624160dd0, {
					type: '17'
				});

				if (databanner_list.data.code != 1) {
					this.$message.info(databanner_list.data.msg);
					return
				}
				let infobanner_list = databanner_list.data;
				this.banner_list = infobanner_list.data

			},
			pagingListPostData() {
				return this.pagingListPostDataContent
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #F6F6F6;
		background-size: 100% auto;
	}

	.trends_flex_0 {
		background: #d53215;
		// ;
		background-size: 100% auto;
		height: 100rpx;
		width: 100%;
		// padding: 66rpx 32rpx 0rpx 32rpx;
		position: fixed;
		top: 0;
		left: 0;
		z-index: 1000000000000000;
		margin: 0rpx 0rpx 0rpx 0rpx;
	}

	.trends_fd0_0_c2 {
		font-size: 32rpx;
		color: var(--benbenFontColor3);
	}

	.trends_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 500;
		line-height: 50rpx;
		color: var(--benbenFontColor3);
		margin: 0rpx 0rpx 0rpx 12rpx;
	}

	.trends_fd0_0_c0 {
		font-size: 36rpx;
		color: var(--benbenFontColor3);
	}

	.trends_fd0_0 {
		background-color: #d53215;
		width: 100%;
		// margin: -71rpx 0rpx 0rpx -34rpx;
		height: 100rpx;
		position: fixed;
		padding: 0rpx 32rpx 0rpx 32rpx;
		z-index: 966666666;
		background-size: 100% auto;
	}

	.trends_flex_1 {
		// margin: -125rpx 0rpx 0rpx 0rpx;
		position: fixed;
		// top: 132rpx;
		left: 0;
		z-index: 10000000000;
		background-color: #d53215;
	}

	.trends_titleItemfd1_0_c3_c0 {
		color: var(--benbenFontColor3);
	}

	.trends_titlefd1_0_c3 {
		margin: 0rpx 30rpx 0rpx 30rpx;
	}

	.trends_linefd1_0 {
		background: #fff;
		width: 30rpx;
		height: 8rpx;
		top: 80rpx;
		background-size: 100% auto !important;
		border-radius: 16rpx;
	}

	.checkTitlefd1_0 {
		font-weight: 700 !important;
		font-size: 28rpx !important;
		color: #FFFFFF !important;
	}

	::v-deep .trends_benbenTabsfd1_0 {
		width: 750rpx;
		height: 90rpx;
		white-space: nowrap;
		text-align: center;
	}

	.trends_flex_2 {
		margin: 100rpx 0rpx 0rpx 0rpx;
		// position: absolute;
		// top: 252rpx;
		// left: 25rpx;
	}

	.trends_numberfd2_0_c0 {
		background: #525050;
		position: absolute;
		bottom: 20rpx;
		right: 30rpx;
		width: 80rpx;
		height: 40rpx;
		border-radius: 6rpx 6rpx 6rpx 6rpx;
		font-size: 24rpx;
		color: #FFFFFF;
		line-height: 46rpx;
		font-weight: 400;
	}

	.trends_fd2_0_c1_c0 {
		width: 702rpx;
		height: 324rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.trends_fd2_0 {
		width: 702rpx;
		height: 324rpx;
	}

	.trends_swiperDotUnselectedfd2_0 {
		background: rgba(255, 255, 255, 0.39);
		width: 12rpx;
		height: 12rpx;
		border-radius: 6rpx 6rpx 6rpx 6rpx;
		margin: 0rpx 6rpx 0rpx 0rpx;
		color: #fff;
		background-size: 100% auto !important;
	}

	.trends_swiperDotSelectedfd2_0 {
		background: rgba(255, 255, 255, 1);
		width: 12rpx;
		height: 12rpx;
		border-radius: 6rpx 6rpx 6rpx 6rpx;
		margin: 0rpx 6rpx 0rpx 0rpx;
		background-size: 100% auto !important;
	}

	::v-deep .trends_swiperDotfd2_0 {
		position: absolute;
		bottom: 20rpx;
		left: 0rpx;
		right: 0rpx;
	}

	.trends_flex_3 {
		margin: 27rpx 0rpx 0rpx 0rpx;
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.trends_fd3_0_c1 {
		width: 248rpx;
		height: 160rpx;
		border-radius: 16rpx;
	}

	.trends_fd3_0_c0_c1_c0 {
		line-height: 33rpx;
		margin: 0rpx 20rpx 0rpx 0rpx;
	}

	.trends_fd3_0_c0_c1 {
		height: 40rpx;
		color: rgba(153, 153, 153, 1);
		font-size: 24rpx;
	}

	.trends_fd3_0_c0_c0 {
		-webkit-line-clamp: 2;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		font-size: 28rpx;
		font-weight: 500;
		color: rgba(51, 51, 51, 1);
		line-height: 40rpx;
	}

	.trends_fd3_0_c0 {
		width: 364rpx;
		height: 100%;
		margin: 0rpx 20rpx 0rpx 0rpx;
	}

	.trends_fd3_0 {
		background: #fff;
		margin: 0rpx 0rpx 24rpx 0rpx;
		height: 208rpx;
		width: 686rpx;
		background-size: 100% auto;
		border-radius: 16rpx;
		padding: 24rpx;
	}
	.btns{
		width: 120rpx;
	}
</style>
